import { api, dataHandler } from 'utils/http';

const url = '/api/user';
const authUrl = '/api/auth';

const listUser = () => api.get(url).then(dataHandler);

const updateUser = (data) => api.put(url, data).then(dataHandler);

const register = (data) => api.post(url, data).then(dataHandler);

const auth = (data) => api.post(authUrl, data).then(dataHandler);

export {
  listUser,
  register,
  updateUser,
  auth,
};
